package com.wuyou.sso.common.excption;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wuyou.sso.common.component.CustomizedOAuth2ExceptionSerializer;
import lombok.Getter;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

/**
 * @author lishangbu
 * @date 2018/7/8 自定义OAuth2Exception
 */
@JsonSerialize(using = CustomizedOAuth2ExceptionSerializer.class)
public class CustomizedAuth2Exception extends OAuth2Exception {

    private static final long serialVersionUID = 1L;
    @Getter
    private String errorCode;

    public CustomizedAuth2Exception(String msg) {
        super(msg);
    }

    public CustomizedAuth2Exception(String msg, String errorCode) {
        super(msg);
        this.errorCode = errorCode;
    }
}
